//
//  StrokeRecord.h
//  StrokeDemo
//
//  Created by wankang on 2/16/15.
//  Copyright (c) 2015 wankang. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef struct tagShortPoint {
    short   x;
    short   y;
}StrokePoint;

/** stroke record of one contour
 */
@interface StrokeRecord : NSObject {
    
}
@property (nonatomic) NSString *code;
@property (nonatomic) NSInteger indexContour;
@property (nonatomic) NSString *nameStroke;
@property (nonatomic) NSInteger xStart;
@property (nonatomic) NSInteger yStart;
@property (nonatomic) NSInteger type;
@property (nonatomic) BOOL      endStroke;
@property (nonatomic) NSInteger endAngle;
@property (nonatomic) NSArray   *arrContour;
@property (nonatomic) NSArray   *arrMiddle;

-(id)init;
-(void)dealloc;

-(BOOL)isBuShou;
-(BOOL)isStrokeEnd;
-(BOOL)getContour:(StrokePoint *)pt fromIndex:(NSInteger)index;
-(BOOL)getMidline:(StrokePoint *)pt fromIndex:(NSInteger)index;

-(StrokeRecord *)createRecordWithXScale:(float)fX andYScale:(float)fY;
+(NSArray *)createScaledPoint:(NSArray *)array withXScale:(float)fXScale andYScale:(float)fYScale;
@end
